#!/bin/sh

# Add user for "stafflog_checkin" service
predesys-server users add -id stafflog_checkin -gid client -e 1
predesys-server users changep -user stafflog_checkin -passwd stafflog_checkin

# Add services to Predesys Server
predesys-server services add -id stafflog_setup -v "0.1" -tid "callable-system" -a 1 -e 1 -p stafflog_setup.py -name "Stafflog Setup" -author "Jose A. Jimenez <jajimc@gmail.com>, Miguel Centeno <miguelcent@gmail.com>"
predesys-server services add -id stafflog_checkin -v "0.1" -tid "callable-system" -a 0 -e 1 -p stafflog_checkin.py -name "Stafflog Checkin" -author "Jose A. Jimenez <jajimc@gmail.com>, Miguel Centeno <miguelcent@gmail.com>"
	
# Add service permissions to Predesys Server
predesys-server serviceperms add -sid stafflog_setup -gid client
predesys-server serviceperms add -sid stafflog_checkin -gid client

# Import SQL tables to Predesys Server DB
cd /usr/share/predesys-server/services
python install_db.py
